package urnaelectronica;

//conteo de votos, mostrarlo graficamente (que agrege y no copie d vuelta el mismo campo)
//cambiar de dnd levanta el voto.xml (de la carpeta del foco)

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import logger.*;
import shared.Voto;
import java.io.*;
import java.net.*;
import java.util.Vector;
import java.util.Calendar;
import java.util.Collections;
import java.util.GregorianCalendar;
import javax.swing.Timer;
import javax.crypto.SealedObject;
import shared.ElemConteo;
import transfer.*;
import xmlManager.xmlHandler;


public class UrnaElectronica extends javax.swing.JFrame{   
    //Creo un objeto observable
    private Observ observable = new Observ();
    //Creo un logger(observer)
    private logger.Logger log = new logger.Logger();          
    //Padron de las elecciones (Nombre-DNI)
    private Vector<Persona> padron = new Vector<Persona>();
    //Vector donde se guardan todos los votos
    private Vector<Voto> votos = new Vector<Voto>();
    //Vector de lo que se va a votar
    private Vector<String> aVotar = new Vector<String>();  
    //Booleano que contiene si se inicio o no la votacion    
    private boolean inicioVotacion = false;
    
    private boolean huboRespuesta = false;

    public UrnaElectronica() {
        initComponents();
        levantarVotos();
        Persona admin = new Persona("Gaston Claret",35043314,true);
        padron.add(admin);
        //Hago que el logger observe al observable
        observable.addObserver(log);
    }
    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        xmlHandler.cargarPuestos();
        jLayeredPane1 = new javax.swing.JLayeredPane();
        jPanel1 = new javax.swing.JPanel();
        setPadronButton = new javax.swing.JButton();
        sendVotesButton = new javax.swing.JButton();
        backButton1 = new javax.swing.JButton();
        jLabel3 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        setDNIButton = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        backButton4 = new javax.swing.JButton();
        jLabel5 = new javax.swing.JLabel();
        jTextField2 = new javax.swing.JTextField();
        sendDataButton = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        statusText = new javax.swing.JLabel();
        jSeparator2 = new javax.swing.JSeparator();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setMinimumSize(new java.awt.Dimension(350, 300));
        setResizable(false);

        jLayeredPane1.setPreferredSize(new java.awt.Dimension(350, 300));

        jPanel1.setPreferredSize(new java.awt.Dimension(350, 260));

        setPadronButton.setText("Cargar Padron");
        setPadronButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                setPadronButtonMouseClicked(evt);
            }
        });

        sendVotesButton.setText("Enviar Votos");
        sendVotesButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                sendVotesButtonMouseClicked(evt);
            }
        });

        backButton1.setText("<< Volver");
        backButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                backButton1ActionPerformed(evt);
            }
        });

        jLabel3.setFont(new java.awt.Font("Trebuchet MS", 3, 18));
        jLabel3.setText("Administrador");

        jButton1.setText("Iniciar Votacion");
        jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton1MouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(269, Short.MAX_VALUE)
                .addComponent(backButton1))
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(75, 75, 75)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(setPadronButton, javax.swing.GroupLayout.DEFAULT_SIZE, 190, Short.MAX_VALUE)
                    .addComponent(sendVotesButton, javax.swing.GroupLayout.DEFAULT_SIZE, 190, Short.MAX_VALUE)
                    .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3))
                .addGap(85, 85, 85))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 35, Short.MAX_VALUE)
                .addComponent(jButton1)
                .addGap(18, 18, 18)
                .addComponent(setPadronButton)
                .addGap(18, 18, 18)
                .addComponent(sendVotesButton)
                .addGap(65, 65, 65)
                .addComponent(backButton1))
        );

        jPanel1.setBounds(0, 0, 350, 260);
        jLayeredPane1.add(jPanel1, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLabel2.setText("Ingresar DNI:");

        setDNIButton.setText("Ingresar");
        setDNIButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                setDNIButtonMouseClicked(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Trebuchet MS", 3, 18));
        jLabel1.setText("Urna Electronica");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap(104, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addComponent(setDNIButton)
                        .addGap(136, 136, 136))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addGap(102, 102, 102))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel2))
                        .addGap(120, 120, 120))))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addGap(52, 52, 52)
                .addComponent(jLabel2)
                .addGap(18, 18, 18)
                .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(setDNIButton)
                .addContainerGap(83, Short.MAX_VALUE))
        );

        jPanel2.setBounds(0, 0, 350, 260);
        jLayeredPane1.add(jPanel2, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jPanel4.setMinimumSize(new java.awt.Dimension(350, 260));
        jPanel4.setPreferredSize(new java.awt.Dimension(350, 260));

        backButton4.setText("<< Volver");
        backButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                backButton4ActionPerformed(evt);
            }
        });

        jLabel5.setText("Ingresar IP");

        jTextField2.setText("localhost");

        sendDataButton.setText("Enviar");
        sendDataButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                sendDataButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap(124, Short.MAX_VALUE)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(backButton4, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel5)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(sendDataButton)
                                .addGap(16, 16, 16)))
                        .addGap(118, 118, 118))))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addGap(78, 78, 78)
                .addComponent(jLabel5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(sendDataButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 105, Short.MAX_VALUE)
                .addComponent(backButton4))
        );

        jPanel4.setBounds(0, 0, 350, 280);
        jLayeredPane1.add(jPanel4, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jPanel3.setMinimumSize(new java.awt.Dimension(350, 300));
        jPanel3.setPreferredSize(new java.awt.Dimension(350, 300));

        statusText.setFont(new java.awt.Font("Arial", 0, 10));
        statusText.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSeparator2, javax.swing.GroupLayout.DEFAULT_SIZE, 350, Short.MAX_VALUE)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(statusText, javax.swing.GroupLayout.DEFAULT_SIZE, 340, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap(284, Short.MAX_VALUE)
                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, 0)
                .addComponent(statusText, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jPanel3.setBounds(0, 0, 350, 300);
        jLayeredPane1.add(jPanel3, javax.swing.JLayeredPane.DEFAULT_LAYER);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(0, 0, 0)
                .addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(0, 0, 0)
                .addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jPanel1.setVisible(false);
        jPanel2.setVisible(true);
        jPanel3.setVisible(true);
        jPanel4.setVisible(false);

        pack();
    }// </editor-fold>//GEN-END:initComponents

public void levantarVotos(){
    FileInputStream fstream;
        try {
            fstream = new FileInputStream("votos.txt");
            DataInputStream in = new DataInputStream(fstream);
            BufferedReader br = new BufferedReader(new InputStreamReader(in));
            String linea;
            while ((linea = br.readLine()) != null){
                votos.add(getVoto(linea));
         }
        } catch (Exception ex) {
            System.out.println(ex.getMessage());
        }
}

private Voto getVoto(String s){
    Voto result = new Voto(xmlHandler.getAvotar());
    String[] split = s.split(";");
    for(int i=0;i<split.length;i++){
        String[] split2 = split[i].split(":");
        result.put(split2[0], split2[1]);
    }
    return result;
}
    
//Cargar Padron
private void setPadronButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_setPadronButtonMouseClicked
       try {
            FileInputStream fstream = new FileInputStream("padron.txt");
            DataInputStream in = new DataInputStream(fstream);
            BufferedReader br = new BufferedReader(new InputStreamReader(in));
            String linea;
            Persona nueva;
            while ((linea = br.readLine()) != null){
                String[] split = linea.split("-");
                nueva = new Persona(split[0],Integer.parseInt(split[1]),false);
                padron.add(nueva);                
            }
            statusText.setText("Padron cargado con exito!");
            observable.notificar("Padron cargado con exito!");
            in.close();
        } catch (Exception ex) {
            statusText.setText("Error: " + ex.getMessage());         
        }
}//GEN-LAST:event_setPadronButtonMouseClicked

//Ingresar DNI
private void setDNIButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_setDNIButtonMouseClicked
    for(Persona p:padron){        
        //Si existe en el padron
        if((p.getDni()).equals(Integer.parseInt(jTextField1.getText()))){
            if(p.isAdmin()){
                jPanel1.setVisible(true);
                jPanel2.setVisible(false);
                jTextField1.setText("");
                statusText.setText("");
                return;
            }            
            else{
                if(inicioVotacion){
                    //Y si ya no voto
                    if(!p.isVoto()){
                        observable.notificar("El DNI " + jTextField1.getText() + " emitio su voto");
                        p.setVoto(true);
                        Voto nuevo = xmlHandler.getVoto();
                        try{
                            FileWriter fout = new FileWriter("votos.txt",true);
                            PrintWriter fileout = new PrintWriter(fout,true);
                            fileout.println(nuevo.toString());                            
                        }
                        catch(Exception e){
                            System.out.println(e.getMessage());
                        }
                        votos.add(nuevo);                    
                        statusText.setText("El DNI " + jTextField1.getText() + " emitio su voto con exito");
                        jTextField1.setText("");
                        return;
                    }
                    //Sino notifico que ya emitio el voto
                    else{
                        observable.notificar("El DNI " + jTextField1.getText() + " ya voto");                    
                        statusText.setText("El DNI " + jTextField1.getText() + " ya voto");
                        return;
                    }
                }
                else{
                    observable.notificar("No se inicio la votacion todavia");                    
                    statusText.setText("No se inicio la votacion todavia");
                    return;
                }
            }
        }
    }
    statusText.setText("El DNI " + jTextField1.getText() + " no existe en el padron");
    observable.notificar("El DNI " + jTextField1.getText() + " quizo votar, pero no existe en el padron");  
}//GEN-LAST:event_setDNIButtonMouseClicked

//Enviar Votos
private void sendVotesButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_sendVotesButtonMouseClicked
    Calendar calendario = new GregorianCalendar();
    int hora;
    //Lo dejo asi para probar.. pero despues hay que dejar la linea d abajo y sacar el hora=19
    //hora = calendario.get(Calendar.HOUR_OF_DAY);
    hora=19;
    if((votos.isEmpty())){
        statusText.setText("No hay votos para enviar");
        observable.notificar("Se trato de enviar los votos, pero no hay nada para enviar");
        statusText.setVisible(true);
    } 
    else{
        if(hora>=18){                
            jPanel2.setVisible(false);
            jPanel1.setVisible(false);
            jPanel4.setVisible(true);
        }
        else{
            statusText.setText("Para enviar los datos debe ser despues de las 18hs");
            observable.notificar("Para enviar los datos debe ser despues de las 18hs");
        }
    }

}//GEN-LAST:event_sendVotesButtonMouseClicked

//Volver
private void backButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_backButton1ActionPerformed
    jPanel1.setVisible(false);
    jPanel2.setVisible(true);
    jPanel4.setVisible(false);
    statusText.setText("");
}//GEN-LAST:event_backButton1ActionPerformed

//Volver
private void backButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_backButton4ActionPerformed
    jPanel1.setVisible(true);
    jPanel2.setVisible(false);
    jPanel4.setVisible(false);
    statusText.setText("");
}//GEN-LAST:event_backButton4ActionPerformed

private void sendDataButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sendDataButtonActionPerformed
    ThreadAdmin a = new ThreadAdmin(this);
    a.execute();
}//GEN-LAST:event_sendDataButtonActionPerformed

private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked
    inicioVotacion = true;
    statusText.setText("Se inicio la votacion");             
    observable.notificar("Se inicio la votacion");
    
}//GEN-LAST:event_jButton1MouseClicked



public Vector<ElemConteo> realizarConteo(){
    Vector<ElemConteo> resultado = new Vector<ElemConteo>();
    ElemConteo aux;
    for(Voto v:votos){
        for(String s:xmlHandler.getAvotar()){
            aux = contieneCandidato(v.get(s),resultado);
            if( aux != null){
                aux.setCantidad(aux.getCantidad()+1);
            }
            else{
                aux = new ElemConteo(s,v.get(s),1);
                resultado.add(aux);
            }
        }   
    }
    Collections.sort(resultado);
    return resultado;
}

private ElemConteo contieneCandidato(String can, Vector<ElemConteo> v){
    for(ElemConteo e:v){
        if(e.getNombre().equals(can))
            return e;
    }
    return null;
}




//Envia los datos al Centro de Recepcion (el mismo tiene que estar corriendo para poder recibir los daots)
public void enviarDatos(){
     String serverResponse = "";
     int puerto = 7777;
     Socket server = null;   
     try {   
            Timer timer = new Timer (300000, new ActionListener ()
{
                public void actionPerformed(ActionEvent e)
                {
                    if(!huboRespuesta)
                        System.out.print("AAAA");
                 }
            });     
            
             Vector<ElemConteo> aEnviar = realizarConteo();            

             //Encripto los votos
             cipher encriptador = new cipher();             
             SealedObject so = encriptador.encriptar(aEnviar);        
             
             server = new Socket(jTextField2.getText(),puerto);
             //Creo el stream de entrada y salida de datos con el servidor
             OutputStream os = server.getOutputStream();  
             ObjectOutputStream oos = new ObjectOutputStream(os);
             BufferedReader in = new BufferedReader(new InputStreamReader(server.getInputStream()));    
             PrintWriter out = new PrintWriter(server.getOutputStream(), true);             
             //Mientras que no llegue la respuesta del servidor que los datos estan bien....
             while(!serverResponse.equals("OK")){
                 timer.start();
                 //Envio la Key
                 oos.writeObject(encriptador.getKey());                 
                 //Envio el Sealed Object
                 oos.writeObject(so);
                 //Envio el MD5
                 out.println(Md5.generateMD5(aEnviar.toString()));
                 // Leo la respuesta del centro d recepcion
                 serverResponse = in.readLine();
                 huboRespuesta = true;
             }
             statusText.setText("Datos enviados con exito");             
             observable.notificar("Se enviaron los datos al centro de recepcion con exito");
             jPanel1.setVisible(true);
             jPanel4.setVisible(false);
     }
      catch(Exception e) {
         if(e.getMessage().equals("Connection refused: connect")){
             statusText.setText("Envio de datos fallido - Conectar al servidor");             
             observable.notificar("Envio de datos fallido - Conectar al servidor");
         }
      } 
}

       public static void main(String args[]) {

        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new UrnaElectronica().setVisible(true);
            }
        });
          

 
    }


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton backButton1;
    private javax.swing.JButton backButton4;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLayeredPane jLayeredPane1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JButton sendDataButton;
    private javax.swing.JButton sendVotesButton;
    private javax.swing.JButton setDNIButton;
    private javax.swing.JButton setPadronButton;
    private javax.swing.JLabel statusText;
    // End of variables declaration//GEN-END:variables

}